﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.Controls;
using System.Drawing;
using Silvermoon.OpenGL;

namespace FileExplorer
{
    public class WaitItem : ListViewItem
    {
        public const int ItemHeight = 450;
        private Label label;

        public WaitItem()
            : base()
        {
            label = new Label { Alignment = Alignment.Center, LineAlignment = Alignment.Center };
            Controls.Add(label);
            this.Size = Control.ScaledSize(320, ItemHeight);
            ShowBorderLine = false;
            label.ScaleFactor = 2f;

        }

        public string Text { get { return label.Text; } set { label.Text = value; } }

        protected override void OnLayout()
        {
            Size size = label.TextSize;
            int w = Math.Min(Width - 10, size.Width);
           
           // label.Bounds = new Rectangle((Width - w) / 2, (Height - size.Height) / 2, w, size.Height + 1);
            label.Bounds = this.ClientBounds;
            base.OnLayout();
        }
    }
}
